import {Pipe, PipeTransform} from '@angular/core';
import * as moment from 'moment'

@Pipe({
  name: 'date',
})
export class DatePipe implements PipeTransform {
  /**
   * Takes a value and makes it lowercase.
   */
  transform(value: string, format = 'YYYY/MM/DD HH:mm:ss') {
    if (value) {
      return moment(value).format(format)
    }else{
      return ''
    }
  }
}
